// formatUtils.js
export function formatNumberToCurrency(value) {
    if (!value && value !== 0) return '0';

    const [intPart, floatPart] = value.toString().split('.');
    const intPartFormat = intPart.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');

    if (floatPart) {
        return `${intPartFormat}.${floatPart}`;
    }

    return intPartFormat;
}

